const { NONAME } = require('dns')
const path = require('path')
const {CleanWebpackPlugin} = require('clean-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
  mode: "none",
  entry: "./src/main.js",
  output: {
    filename: "bundle.js",
    path: path.join(__dirname, "output"),
    // publicPath: 'output/'
  },
  devServer: {
    contentBase:['.public']
  },
  module: {
    rules: [
      {
        test: /.js$/,
        use: {loader:'babel-loader', options: {
          presets: ['@babel/preset-env']
        }}
      },
      {
        test: /.html$/,
        use: {
          loader:'html-loader',
          options:{
            attrs: ['img:src','a:href']
          }
        }
      },
      {
        test: /.vue$/,
        use: 'vue-loader'
      },
      {
        test: /.less$/,
        use: [
          'style-loader',
          'css-loader',
          'less-loader'
        ]
      },
      {
        test: /.png$/,
        use: 'file-loader'
      },
    ]
  },
  plugins: [
    new CleanWebpackPlugin(),
    new HtmlWebpackPlugin({
      title: "webpack",
      meta: {
        viewport: 'width=device-width'
      }
    })
  ]

}